<?php


namespace app\api\model\user;


use think\Model;

class Order extends Model
{
    protected $name = 'order';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';

    public function getPayStatusAttr($value)
    {
        $type = ['pay'=>'已支付','unpay'=>'未支付','close'=>'已关闭'];
        return $type[$value];
    }
    public function business()
    {
        return $this->belongsTo('Business', 'business_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}